package com.example.demo.service;

import com.example.demo.mapper.UserMapper;
import com.example.demo.model.UserInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-10-06
 * Time: 21:21
 */

@Service
public class UserService {
    //需要操作数据库 那么属性注入 mapper 类和接口都可以
    //不是普通的接口 是mybatis的接口
    @Resource
    private UserMapper userMapper;

    public UserInfo getUserById(Integer id){
        return userMapper.getUserById(id);
    }

}
